<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html" xmlns:pe="http://primefaces.org/ui/extensions">

    <h:form id="toolbar-form">

        <p:toolbar>
            <p:toolbarGroup align="left">
                <p:selectBooleanButton value="#{treeAdministrationBean.moveActivated}" onLabel=""
                                       offLabel="" onIcon="ui-icon-arrow-4" offIcon="ui-icon-arrow-4"
                                       disabled="#{treeAdministrationBean.administrationActivated}"
                                       styleClass="tree-boolean-btn">
                    <p:ajax update=":trees_panel @form" listener="#{treeAdministrationBean.onTreeNodeMove}"/>
                </p:selectBooleanButton>

                <p:selectBooleanButton styleClass="tree-administration-btn tree-boolean-btn"
                                       value="#{treeAdministrationBean.administrationActivated}" onLabel=""
                                       offLabel="" onIcon="ui-icon-gear" offIcon="ui-icon-gear"
                                       disabled="#{treeAdministrationBean.moveActivated}">
                    <p:ajax update=":trees_panel @form" listener="#{treeAdministrationBean.onAdministrationTree}"
                            oncomplete="TreeCustomBehavior.init()"/>
                </p:selectBooleanButton>

                <p:outputPanel layout="block" autoUpdate="true" id="transfer_panel">
                    <p:outputPanel layout="block" rendered="#{folderAdministrationBean.transferActivated}">
                        <p:commandButton icon="ui-icon-check" title="Confirma noua destinatie" process="@this"
                                         actionListener="#{orderAdministrationBean.confirmTransfer}"
                                         oncomplete="PF('orderWV').show();"/>
                        <p:commandButton icon="ui-icon-cancel" title="Anuleaza" process="@this"
                                         update=":photo-cantainer-form:order_type_groups"
                                         actionListener="#{folderAdministrationBean.cancelTransfer}"
                                         oncomplete="TreeCustomBehavior.onTransferOff();"/>
                    </p:outputPanel>
                </p:outputPanel>
            </p:toolbarGroup>
        </p:toolbar>
    </h:form>

    <p:outputPanel id="trees_panel" layout="block">

        <p:outputPanel layout="block" rendered="#{!treeAdministrationBean.administrationActivated}">
            <ui:include src="tree-view.xhtml"/>
        </p:outputPanel>

        <p:outputPanel layout="block" rendered="#{treeAdministrationBean.administrationActivated}">
            <ui:include src="tree-roles-administration.xhtml"/>
        </p:outputPanel>
    </p:outputPanel>

</ui:composition>